class Solution:
    def solve(self,n,k,str1,str2):
        T = 0
        for i in range(n):
            if str1[i] == str2[i]:
                T = T+1
        if T>=k:
            max = k+(N-T)
        else:
            max = N-K+2*T


        if n-T>=k:
            min = 0
        else:
            min = k-(n-T)
        return [min,max]

A = Solution()
N,K,STR1,STR2 = input().split(",")
N = int(N)
K = int(K)
print(A.solve(N,K,STR1,STR2))